package com.google.code.jbauble.mvc;

import com.google.code.jbauble.mvc.render.*;

public class ViewRenderManager {
	private ViewRender[] renders = null;
	public ViewRenderManager(String path, String file, DefaultConfiguration config) {
		renders = new ViewRender[3];
		renders[0] = new VelocityViewRender(path, file, config);
		renders[1] = new RedirectViewRender();
		renders[2] = new OutputViewRender();
	}
	
	public ViewRender getRender(Result r) {
		if (r.getType() == Result.RENDER)
			return renders[0];
		if (r.getType() == Result.OUTPUT)
			return renders[2];
		return renders[1];
	}
}
